//
//  ExchangeNumber.m
//  GLCodingInterview
//
//  Created by colyn on 2019/8/22.
//  Copyright © 2019 colyn. All rights reserved.
//

#import "ExchangeNumber.h"

@implementation ExchangeNumber

+ (void)exchangeNumber_1 {
    int a = 3;
    int b = 5;
    
    a = a^b;
    b = a^b;
    a = a^b;
    
    NSLog(@"a = %d,b = %d",a,b);
}

+ (void)exchangeNumber_2 {
    int a = 3;
    int b = 5;
    
    a = a+b;
    b = a-b;
    a = a-b;
    
    NSLog(@"a = %d,b = %d",a,b);
}

@end
